<?php
$this->Html->script('controllers/Surveys/apply.js?1', array('block' => 'scriptBottom'));
?>
<div id='wndAlertSupervisor' class='hidden'>
    <div class="alert alert-info" role="alert" data-title="<?php echo __('Confirmar acción'); ?>">
        <?php
        echo __('Al dar clic en el botón aceptar afirmo que el desempeño del '
                . 'asociado en esta operación cumple con el tiempo ciclo y la calidad '
                . 'requerida.');
        ?>
    </div>
    <button class="btn btn-primary pull-right">
        <?php echo __('Aceptar'); ?>
    </button>
</div>
    <form class="form-inline survey" action="">
    <table class='table table-bordered table-condensed'>
        <thead>
            <tr>
                <th colspan="5" id='allAnswers'>
                    <?php echo __('Por favor rellene el cuadro apropiado'); ?>
                </th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($appBosch->questions as $key => $group): ?>
                <tr class='header-question text-center'>
                    <th colspan="2">
                        <?php echo $key ?>
                    </th>
                    <th><?php echo __('Si'); ?></th>
                    <th><?php echo __('No'); ?></th>
                    <th><?php echo __('Comentarios'); ?></th>
                </tr>
                <?php foreach ($group as $question): ?>
                    <tr class='question'>
                        <td>
                            <?php echo $question['orden'] ?>
                        </td>
                        <td>
                            <?php echo $question['question'] ?>
                        </td>
                        <td>
                            <label class="checkbox-inline answer">
                                <input value='1' type="radio" name="answer[<?php echo $question['id']; ?>]">
                                <?php echo __('Si'); ?>
                            </label>
                        </td>
                        <td>
                            <label class="checkbox-inline answer">
                                <input value='0' type="radio" name="answer[<?php echo $question['id']; ?>]">
                                <?php echo __('No'); ?>
                            </label>
                        </td>
                        <td>
                            <div class="form-group comment">
                                <label class="sr-only" for="comment"><?php echo __('Comentario'); ?></label>
                                <input name='name[<?php echo $question['id']; ?>]' type="text" class="form-control" id="comment" placeholder="<?php echo __('Comentario'); ?>">
                            </div>
                        </td>
                    </tr>
                <?php endforeach; ?>
            <?php endforeach; ?>
        <tbody>
    </table>
    <div class='qualification'>
        <div class='pull-left'>
            <label><?php echo __('Calificación:'); ?></label>
            <span id='qualification' class='text-danger'>0.00</span>
            <i class='fa fa-check text-success hidden'></i>
        </div>
        <button class="btn btn-primary pull-right" type='button' id="save">
            <?php echo __('Guardar'); ?>
        </button>
    </div>
    <hr/>
    <hr/>
    <hr/>
    <hr/>
    <hr/>
</form>
<style>
    form.data div.block{
        text-align: right;
    }
    form.data div.block span{
        text-decoration: underline;
    }
    div.qualification{
        font-size: 4rem;
        font-weight: bold;
    }
</style>
<?php $this->start('jsVars'); ?>
<script type="text/javascript">
    var appBosch = <?php echo json_encode($appBosch); ?>;
</script>
<?php
$this->end();
